package com.maila.xiaoaobusiness.activity;

import android.app.AlertDialog;
import android.os.Bundle;
import android.support.annotation.Nullable;

import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import com.dinuscxj.refresh.RecyclerRefreshLayout;
import com.maila.xiaoaobusiness.R;
import com.maila.xiaoaobusiness.adapter.OrderAdapter;
import com.maila.xiaoaobusiness.utils.AlertUtil;
import com.zhy.autolayout.AutoRelativeLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 订单管理
 * Created by mark on 2017/12/2.
 */

public class OrderManageActivity extends AppCompatActivity {
    @BindView(R.id.white_return_iv)
    AutoRelativeLayout whiteReturnIv;
    @BindView(R.id.tv_clean)
    TextView tvClean;
    @BindView(R.id.lv_order)
    ListView lvOrder;
    @BindView(R.id.refresh_layout)
    RecyclerRefreshLayout refreshLayout;
    OrderAdapter orderAdapter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_order_manage);
        ButterKnife.bind(this);
        orderAdapter=new OrderAdapter(this);
        lvOrder.setAdapter(orderAdapter);
        refreshLayout.setOnRefreshListener(new RecyclerRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {

            }
        });
    }

    @OnClick({R.id.white_return_iv, R.id.tv_clean})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.white_return_iv:
                break;
            case R.id.tv_clean:
                AlertUtil.ShowDialog(this, "确认清空订单列表么？", "清空后无法恢复", new AlertUtil.Alertlinstner() {
                    @Override
                    public void clickConfirm() {

                    }

                    @Override
                    public void clickSingle(int position) {

                    }
                });
                break;
        }
    }
}
